package com.cy.mall.web.front.industrycode;

import com.cy.mall.model.Result;
import com.cy.mall.model.domain.industry.IndustryCode;
import com.cy.mall.service.industrycode.IndustryCodeService;
import com.cy.mall.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description 前台-国标行业代码
 * @Author tanyilin
 * @Date 2019/3/20 11:56
 */
@RestController
@RequestMapping("/industry/code")
@Api(tags = "前台-国标行业代码")
public class IndustryCodeController extends BaseController {

    @Autowired
    private IndustryCodeService industryCodeService;

    @ApiOperation("获取行业列表")
    @GetMapping("/list")
    public Result<List<IndustryCode>> getIndustryCodeList(@RequestParam(value = "parentId") Long parentId) {

        List<IndustryCode> list = industryCodeService.selectIndustryCodeByParentId(parentId);
        return ok("", list);
    }

}
